import Vue from 'vue'
import VueRouter from 'vue-router'
import About from '../views/About.vue'
import Main from '../views/Main.vue'
import Add from '../views/add.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',   //name可以不用写
    component: Main,
    // children:[
    //   {path: '/categories/create',component:CategoryEdit}
    // ]
  },
  {
    path: '/about/edit',
    name: 'about',
    component: About,
    // component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')  vue3.0的新的写法
  },
  {
  path: '/about/add',
    name: 'add',
    component: Add,
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')  vue3.0的新的写法
  }

]

const router = new VueRouter({
  routes
})

export default router
